﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MBSPL.UserControls.MovieScheduleUserControl
{
    public partial class RemoveMovieScheduleUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadMovieSchedule();
        }

        protected void MovieDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoadMovieSchedule();
        }

        protected void CinemaDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoadMovieSchedule();
        }

        protected void ScreenDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoadMovieSchedule();
        }

        private void LoadMovieSchedule(){
            MBSBLC.BLC blc = new MBSBLC.BLC();
            int MovieID = Convert.ToInt32(MovieDropDownList.SelectedValue);
            int CinemaID = Convert.ToInt32(CinemaDropDownList.SelectedValue);
            int ScreenNo = Convert.ToInt32(ScreenDropDownList.SelectedValue);
            MovieScheduleGridView.DataSource = blc.GetMovieScheduleByMovieAndCinemaAndTheatreNo(MovieID, CinemaID, ScreenNo);
            MovieScheduleGridView.DataBind();
        }
    }
}